import {createStore}  from 'redux'
import shopReduce from './shop/shop'



import {persistStore, persistReducer} from 'redux-persist'
import storage from 'redux-persist/lib/storage'
//引入汇总之后的reducer
 
 
//在localStorge中生成key为root的值
const persistConfig = {
  key: 'shoped',
  storage,
//   blacklist:['loading']  //设置某个reducer数据不持久化，
                         //注意单词的拼写！我就因为写错单词，找了半天,55555~
}
 
const myPersistReducer = persistReducer(persistConfig, shopReduce)
 
const store = createStore(myPersistReducer)
 
const persistor = persistStore(store)
 
export {
  store,
  persistor
}



export default store 